import React from 'react';
import cn from 'classnames';
import { Icon } from 'antd';

// 图标
const CustomIcon = ({ type, className, isAntdIcon, ...rest }) => (
    <>
        {isAntdIcon !== undefined && isAntdIcon ? (
            <i {...rest} className={cn('iconfont', `icon${type}`, className)}>
                <Icon type={type} />
            </i>
        ) : (
            <i {...rest} className={cn('iconfont', `icon${type}`, className)}>
                <em />
            </i>
        )}
    </>
);

export default CustomIcon;
